
#ifndef VERTEXPICKER_H
#define VERTEXPICKER_H

#include <BPolygon>
#include <BCamera>
#include <BPicker>

using namespace BWE;

class AdsorbVertexPicker : public BPicker
{
public:
	AdsorbVertexPicker();
	~AdsorbVertexPicker();

	void setCamera(BCamera* camera);
	BCamera* camera() const;

	void setAdsorbPoint(bool adsorbPoint);
	bool adsorbPoint() const;

	void setAdsorbLineMiddle(bool adsorbLineMiddle);
	bool adsorbLineMiddle() const;

	void setAdsorbPolygonCenter(bool adsorbPolygonCenter);
	bool adsorbPolygonCenter() const;

	BPickHit* pickPlane(const BPlane& plane);

protected:
	bool pickPoint(BShape* shape, const BLine& line, const BVector& point);
	bool pickLine(BShape* shape, const BLine& line, const BVector& begin, const BVector& end);
	bool pickPolygon(BShape* shape, const BLine& line, const BPolygon& polygon);

protected:
	virtual void reset();
	virtual void pick(const BLine& line, BNode* node);
	virtual void pick(const BLine& line, BShape* shape);
	virtual void pick(const BLine& line, BMesh* mesh);
	virtual void pick(const BLine& line, BGeometry* geometry);

private:
	BCamera*	_camera;
	bool		_linePicked;
	bool		_adsorbPoint;
	bool		_adsorbLineMiddle;
	bool		_adsorbPolygonCenter;

};

#endif
